
const request = require('../../../../../utils/request');
let num = 15;
function loadingData(that,page,num){
    if(that.data.upflag){
        request.HttpRequst(true,'funds',false,'',{"page":page,"per_page": num,"token": wx.getStorageSync('sessionId')},"post",false,res => {
            console.log(res.data.data)
            if(res.data != ''){
                let goodsData = that.data.detail.concat(res.data.data)
                that.setData({
                    detail: goodsData
                })
            }else{
                that.setData({
                    upflag: false
                })
            }
        })
    }  
}

Page({
    data: {
        detail: '',
        upflag: true,
        page:1
    },
    onLoad: function() {
        request.HttpRequst(true, 'funds', false, '', {"page":this.data.page,"per_page": num,"token": wx.getStorageSync('sessionId')}, "post", false, res =>{
            console.log(res)
            this.setData({
                detail: res.data.data
            })
        })
    },
    /*下拉获取更多电影数据*/
    onReachBottom:function(){
        var that = this;
        that.data.page++;
        loadingData(that,that.data.page,num);
    },
})